package demo.um.eventhandler;

import javax.enterprise.event.Observes;
import javax.inject.Inject;

import demo.um.controller.EventController;
import demo.um.event.SayEvent;
import demo.um.quilifier.Goodbye;
import demo.um.quilifier.Hello;

public class SayEventHandler {

	private String message;

	@Inject
	private EventController eventController;

	public void helloEventHandler(@Observes @Hello SayEvent e) {
		message = "Say Hello to " + e.getName();
		eventController.setMessage(message);
	}

	public void goodbyeEventHandler(@Observes @Goodbye SayEvent e) {
		message = "Say Goodbye to " + e.getName();
		eventController.setMessage(message);
	}

}